#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
    vector<vector<int>> generate(int numRows) {
        vector<vector<int>> vv(numRows, vector<int>());
        for (size_t i = 0; i < numRows; i++)
        {
            vv[i].resize(i + 1, 1);
        }

        for (size_t i = 0; i < vv.size(); i++)
        {
            for (size_t j = 1; j < vv[i].size() - 1; j++)
            {
                vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];
            }
        }

        return vv;

    }
};